package com.google.gson;

import com.google.gson.internal.a;
import com.google.gson.internal.h;
import com.sutuijingling.result.WorkStatus;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;

public final class d {
    private static final b a = new v(f());
    private final Class b;
    private final Field c;
    private final Class d;
    private final boolean e;
    private final int f;
    private final String g;
    private Type h;
    private Collection i;

    d(Class cls, Field field) {
        this.b = (Class) a.a((Object) cls);
        this.g = field.getName();
        this.d = field.getType();
        this.e = field.isSynthetic();
        this.f = field.getModifiers();
        this.c = field;
    }

    private static Annotation a(Collection collection, Class cls) {
        for (Annotation annotation : collection) {
            if (annotation.annotationType() == cls) {
                return annotation;
            }
        }
        return null;
    }

    private static int f() {
        int i = WorkStatus.ModifyInput1;
        try {
            i = Integer.parseInt(System.getProperty("com.google.gson.annotation_cache_size_hint", String.valueOf(WorkStatus.ModifyInput1)));
        } catch (NumberFormatException e) {
        }
        return i;
    }

    public String a() {
        return this.g;
    }

    public Annotation a(Class cls) {
        return a(d(), cls);
    }

    public boolean a(int i) {
        return (this.f & i) != 0;
    }

    public Type b() {
        if (this.h == null) {
            this.h = this.c.getGenericType();
        }
        return this.h;
    }

    public Class c() {
        return this.d;
    }

    public Collection d() {
        if (this.i == null) {
            h hVar = new h(this.b, this.g);
            Collection collection = (Collection) a.a(hVar);
            if (collection == null) {
                collection = Collections.unmodifiableCollection(Arrays.asList(this.c.getAnnotations()));
                a.a(hVar, collection);
            }
            this.i = collection;
        }
        return this.i;
    }

    boolean e() {
        return this.e;
    }
}
